import request from '@/utils/request'

// 技能列表-分页查询
export function getSkillsList(res) {
  return request({
    url: '/studySkills/getList',
    method: 'get',
    params: res
  })
}
// 技能列表-批量删除
export function delSkills(ids) {
  return request({
    url: '/studySkills/delSkills/'+ids,
    method: 'delete'
  })
}
// 技能列表-获取技能对应批次信息
export function getSkillsBatchList(id) {
  return request({
    url: '/studySkills/getSkillsBatchList/'+id,
    method: 'get',
  })
}

// 技能编辑列表-根据id查询指定技能内容
export function getStudySkillsById(id) {
  return request({
    url: '/studySkills/getStudySkillsById/'+id,
    method: 'get',
  })
}
// 技能编辑列表-新增修改
export function editSkills(data) {
  return request({
    url: '/studySkills/editSkills',
    method: 'post',
    data: data
  })
}


// 试题关联-查询技能关联试题
export function getRelatedQuestionsList(res) {
  return request({
    url: '/studySkills/getRelatedQuestionsList/',
    method: 'get',
    params: res
  })
}
// 试题关联-查询技能未关联试题
export function getUnRelatedQuestionsList(res) {
  return request({
    url: '/studySkills/getUnRelatedQuestionsList',
    method: 'get',
    params: res
  })
}
// 试题关联-关联试题
export function relatedQuestions(id,ids) {
  return request({
    url: '/studySkills/relatedQuestions/'+id,
    method: 'post',
    data: ids
  })
}
// 试题关联-解绑试题
export function unRelatedQuestions(id,ids) {
  return request({
    url: '/studySkills/unRelatedQuestions/'+id,
    method: 'post',
    data: ids
  })
}


// 用户关联-查询技能批次关联用户
export function getRelatedUserList(res) {
  return request({
    url: '/studySkills/getRelatedUserList/',
    method: 'get',
    params: res
  })
}
// 用户关联-查询技能批次未关联用户
export function getUnRelatedUserList(res) {
  return request({
    url: '/studySkills/getUnRelatedUserList',
    method: 'get',
    params: res
  })
}
// 用户关联-关联用户
export function relatedUsers(id,ids) {
  return request({
    url: '/studySkills/relatedUsers/'+id,
    method: 'post',
    data: ids
  })
}
// 用户关联-解绑用户
export function unRelatedUsers(id,ids) {
  return request({
    url: '/studySkills/unRelatedUsers/'+id,
    method: 'post',
    data: ids
  })
}



//技能批次编辑列表-获取技能下最后一批次的信息
export function getLastBatchBySkillsId(id) {
  return request({
    url: '/studySkills/getLastBatchBySkillsId/'+id,
    method: 'get',
  })
}
//技能批次编辑列表-获取指定批次信息
export function getBatchById(id) {
  return request({
    url: '/studySkills/getBatchById/'+id,
    method: 'get',
  })
}
//技能批次编辑列表-新增修改技能批次
export function editBatch(data) {
  return request({
    url: '/studySkills/editBatch',
    method: 'post',
    data: data
  })
}
//技能批次编辑列表-删除批次
export function delBatch(id) {
  return request({
    url: '/studySkills/delBatch/'+id,
    method: 'delete'
  })
}
//技能批次编辑列表-启用批次
export function openBatch(batchId,skillsId) {
  return request({
    url: '/studySkills/openBatch/?batchId='+batchId+'&skillsId='+skillsId,
    method: 'get'
  })
}
//技能批次编辑列表-关闭批次
export function closeBatch(id) {
  return request({
    url: '/studySkills/closeBatch/'+id,
    method: 'get',
  })
}







